var myModule = angular.module('myModule', []);
myModule.directive('superman', function(){
	return {
		scope: {}, // {} = isolate, true = child, false/undefined = no change
		restrict: 'AE', // E = Element, A = Attribute, C = Class, M = Comment
		controller: function($scope, $element, $attrs, $transclude) {
			$scope.abilities = [];
			this.addStrength = function(){
				$scope.abilities.push("strength");
			};
			this.addSpeed = function(){
				$scope.abilities.push("speed");
			};
			this.addLight = function(){
				$scope.abilities.push("light");
			};
		},
		link: function($scope, iElm, iAttrs, controller) {
			iElm.addClass("btn btn-primary");
			iElm.bind("mouseenter",function(){
				console.log($scope.abilities);
			});
		}
	};
});

myModule.directive('strength', function(){
	// Runs during compile
	return {
		require: '^superman', // Array = multiple requires, ? = optional, ^ = check parent elements
		link: function($scope, iElm, iAttrs, controller) {
			controller.addStrength();
		}
	};
});

myModule.directive('speed', function(){
	// Runs during compile
	return {
		require: '^superman', // Array = multiple requires, ? = optional, ^ = check parent elements
		link: function($scope, iElm, iAttrs, controller) {
			controller.addSpeed();
		}
	};
});
myModule.directive('light', function(){
	// Runs during compile
	return {
		require: '^superman', // Array = multiple requires, ? = optional, ^ = check parent elements
		link: function($scope, iElm, iAttrs, controller) {
			controller.addLight();
		}
	};
});